<template>
  <div>
    <div class="mtb20">
      发票记录（共{{tableParams.total}}条）
      <span class="fr">
        <span class="pr10">开票总金额：<span class="fc-blue">￥{{invoicePrice}}</span></span>
      </span>
    </div>
    <zm-table-data :data="tableParams.data" :columns="columns" :fetch="loadList" :table-params="tableParams"></zm-table-data>
  </div>
</template>

<script>
import tableMixin from '@/mixins/zmTableMixin'
import { invoiceColumns } from './const'
import invoiceApi from '@/api/src/invoice'
export default {
  mixins: [tableMixin],
  props: {
    infoData: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      invoicePrice: ''
    }
  },
  computed: {
    columns () {
      return invoiceColumns(this)
    }
  },
  created () {
  },
  methods: {
    async loadList () {
      const res = await invoiceApi.getpagelist(this.assignQuery({ number: this.infoData.orderNo, status: '2', listType: '1' }))
      this.invoicePrice = res.invoicePrice
      this.initialTableData(res.list, res.count)
    },
    onDetail (row) {
      // 跳转到xx详情
    }
  }
}
</script>
